package com.sc.design.memento;

/**
 * @author sc
 * Created on  2017/12/6
 */
public class Boy {
    private String state = "";

    public void changeState(){
        state="不爽了";
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public Memento createMemento(){
        return  new Memento(this.state);
    }

    public void restore(Memento memento){
        this.setState(memento.getState());
    }
}
